package com.schoolcloud.serve.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.schoolcloud.serve.entity.GroupAttrValue;
import com.schoolcloud.serve.service.GroupAttrValueService;
import com.schoolcloud.serve.mapper.GroupAttrValueMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author hongmizfb
 * @description 针对表【group_attr_value(通用属性值表)】的数据库操作Service实现
 * @createDate 2025-04-20 13:51:10
 */
@Service
public class GroupAttrValueServiceImpl extends ServiceImpl<GroupAttrValueMapper, GroupAttrValue>
        implements GroupAttrValueService {

    @Override
    public List<String> getAttributeValuesByAttributeIdAndSpuId(String attributeId, String spuId) {
        return lambdaQuery()
                .eq(GroupAttrValue::getAttrId, attributeId)
                .eq(GroupAttrValue::getSpuId, spuId)
                .select(GroupAttrValue::getAttributeValue).list()
                .stream().map(GroupAttrValue::getAttributeValue).toList();
    }
}




